/**
 * 集合类
 */

type Key = keyof any;

class Collection<T = any> {
  static collection: Collection = new Collection();

  private constructor() {}

  private containerMap = new Map<Key, T>();

  public set(key: Key, value: T) {
    this.containerMap.set(key, value);
  }

  public get(key: Key) {
    return this.containerMap.get(key);
  }

  public has(key: Key) {
    return this.containerMap.has(key);
  }
}

export default Collection.collection;
